<template>
  <div class="plate-card">
    <div class="w-[36px]">
      <el-image :src="icon" class="w-[36px] h-[36px]"></el-image>
    </div>
    <div class="max-w-[376px] ml-[8px] flex-1">
      <div class="card-header">
        <div class="title ml-2">{{ title }}</div>
        <img :src="TitleBorder" alt="" class="title-border" />
        <slot name="header-action" />
      </div>
      <div class="card-body">
        <slot />
      </div>
    </div>
  </div>
</template>

<script lang="ts" setup>
  import TitleBorder from '@/assets/images/card-title/title-border.png'
  defineProps({
    title: {
      type: String,
      default: '标题'
    },
    icon: {
      type: String,
      default: ''
    }
  })
</script>

<style lang="scss" scoped>
  .plate-card {
    display: flex;
    width: 420px;
    max-width: 420px;
    .card-header {
      position: relative;
      display: flex;
      align-items: center;
      //justify-content: space-between;
      padding: 0 16px 0 0;
      height: 36px;
      //background: url('@/assets/images/card-header.png') no-repeat;
      background-size: 100% 100%;
      .title {
        padding-bottom: 4px;
        font-size: 18px;
        font-weight: bold;
      }
      .title-border {
        position: absolute;
        bottom: 0;
        right: 0;
        width: 100%;
      }
    }
    .card-body {
      flex: 1;
      //background: rgba(6, 107, 83, 0.2);
    }
  }
</style>
